package com.zch.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private  Integer code;//状态码
    private  Boolean flag;
    private  String message;
    private  Object data;

    private  static Result success(){
        return  new Result (20000,true,"操作成功",null);
    }
    private  static Result success(Object data){
        return  new Result (20000,true,"操作成功",data);
    }
    private  static Result error(String message){
        return  new Result (20001,true,message,null);
    }
    private  static Result error(String message,Object data){
        return  new Result (20000,true,message,data);
    }

}
